/**
 * 服务器上传地址
 */
export const uploadUrl = `${import.meta.env.VITE_API_URL}/common/upload`;

/**
 * 预览文件
 * @param filename 文件名称
 */
export const fileView = (filename: string) => {
    if (!filename) return null;
    if (filename.startsWith('http')) {
        return filename;
    }
    return `${import.meta.env.VITE_API_URL}/common/view/${filename}`;
};
